package com.base.cn.platform.os.service.manage.op.affiche;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 接收消息管理接口
 *
 * @author zsw
 * @create 2018-06-4
 */
@FeignClient(name = BaseService.appName, configuration = FeignAuthConfig.class)
public interface OpReceiveAfficheService extends BaseService {

    /**
     * 系统自动发送消息
     * @param key 缓存中的Key
     */
    @RequestMapping(contextPath + "/op/sendMessage")
    void sendMessage(@RequestParam("key") String key);


    @RequestMapping(contextPath + "/op/saveReceiveAffichBatch")
    void saveReceiveAffichBatch(@RequestParam("userId") BigDecimal userId);

    /**
     * 查询接收消息列表
     *
     * @param currentPage    分页
     * @param receiveAffiche 查询条件
     * @param subjectData    是否设置专业科目
     * @param courseData     是否设置课程
     * @param sysUserData    是否设置创建人
     */
    @RequestMapping(contextPath + "/op/queryAjaxReceiveAfficheList")
    Map<String, Object> queryAjaxReceiveAfficheList(@RequestParam(value = "currentPage", required = false, defaultValue = "1") Integer currentPage,
                                                    @RequestBody Map<String, Object> receiveAffiche,
                                                    @RequestParam("subjectData") boolean subjectData,
                                                    @RequestParam("courseData") boolean courseData,
                                                    @RequestParam("sysUserData") boolean sysUserData);

    /**
     * 查询班级通知列表
     * @param currentPage 分页
     * @param receiveAffiche 查询条件
     * @param subjectData 是否设置专业科目
     * @param courseData 是否设置课程
     * @param sysUserData 是否设置创建人
     * @return
     */
    @RequestMapping(contextPath + "/op/queryAjaxReceiveAfficheLetterList")
    Map<String, Object> queryAjaxReceiveAfficheLetterList(@RequestParam(value = "currentPage", required = false, defaultValue = "1") Integer currentPage,
                                                          @RequestBody Map<String, Object> receiveAffiche,
                                                          @RequestParam("subjectData") boolean subjectData,
                                                          @RequestParam("courseData") boolean courseData,
                                                          @RequestParam("sysUserData") boolean sysUserData);

    /**
     * 修改接收消息状态
     *
     * @param userId 用户id
     */
    @RequestMapping(contextPath + "/op/updateReceiveArticleStatusById")
    Map<String, Object> updateReceiveArticleStatusById(@RequestParam("userId") BigDecimal userId);

    /**
     * 删除接收消息
     *
     * @param receiveAfficheId 消息Id串
     */
    @RequestMapping(contextPath + "/op/deleteReceiveAffiche")
    Map<String, Object> deleteReceiveAffiche(@RequestParam("receiveAfficheId") BigDecimal receiveAfficheId);

    /**
     * 删除接收消息
     *
     * @param ids 消息Id串
     */
    @RequestMapping(contextPath + "/op/deleteReceiveAfficheIds")
    Map<String,Object> deleteReceiveAfficheIds(@RequestParam("ids") String ids,@RequestParam("userId")BigDecimal userId);

    /**
     * 保存消息
     *
     * @param receiveAffiche 消息
     * @return 保存结果
     */
    @RequestMapping(contextPath + "/op/saveReceiveAffiche")
    Map<String, Object> saveReceiveAffiche(@RequestBody Map<String, Object> receiveAffiche);

    /**获取未读消息数
     * @param userId 消息
     * @return
     */
    @RequestMapping(contextPath + "/op/countReceiveAffiche")
    Map<String,Object> countReceiveAffiche(@RequestParam("userId") BigDecimal userId);

    /**
     * 修改消息状态为已读
     * @param id 消息ID
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/op/updateReceiveAfficheById")
    Map<String,Object> updateReceiveAfficheById(@RequestParam("id") BigDecimal id, @RequestParam("userId") BigDecimal userId);

    /**
     * 删除班级通知
     *
     * @param   afficheRandoms
     * @return 保存结果
     */
    @RequestMapping(contextPath + "/op/deleteReceiveClassAfficheIds")
    Map<String, Object> deleteReceiveClassAfficheIds(@RequestParam("afficheRandoms") String  afficheRandoms);
}
